package com.neihe.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.neihe.entity.dto.file.QueryFileListContextDTO;
import com.neihe.entity.UserFile;
import com.neihe.entity.dto.file.*;
import com.neihe.entity.vo.file.BreadcrumbVO;
import com.neihe.entity.vo.file.FolderTreeNodeVO;
import com.neihe.entity.vo.file.UserFileVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户文件信息表 服务类
 * </p>
 *
 * @author neihe
 * @since 2025-01-05
 */
public interface IUserFileService extends IService<UserFile> {

    String skipUpload(UploadFileDTO requestParam);

    Map<String, String> getUploadSign(Long fileSize);

    void ossCallback(HttpServletRequest request);

    /**
     * 查询文件集合业务
     *
     * @param context 上下文对象
     * @return 结果
     */
    List<UserFileVO> getFileList(QueryFileListContextDTO context);

    List<BreadcrumbVO> getBreadcrumbs(Long fileId, Long userId);

    /**
     * 创建文件业务
     *
     * @param requestParam 请求参数
     * @return 新文件夹ID
     */
    Long createFolder(CreateFolderDTO requestParam);

    UserFile getUserRootFile(Long userId);

    void updateFilename(UpdateFilenameDTO requestParam);

    void recycleFile(RecycleFileDTO requestParam);

    List<FolderTreeNodeVO> getFolderTree(Long userId);

    void transfer(TransferFileDTO requestParam);

    List<UserFile> findAllFileRecords(List<UserFile> records);

    /**
     * 递归查询所有的子文件信息
     *
     * @param fileIds 文件ID集合
     */
    List<UserFile> findAllFileRecordsByFileIdList(List<Long> fileIds);

    String download(Long fileId, Long userId);

    String preview(Long fileId, Long userId);
}
